package at.ac.lbg.media.vis.client.theme.view
{
	import mx.collections.ArrayCollection;
	import mx.core.Application;
	
	public class LegendManager
	{
		private var selectedCats:ArrayCollection;
		public function LegendManager(sc:ArrayCollection) {
			selectedCats = sc;
		}
		
		public function handleSelectCategory(category:Category):void {
			if (category.isSelected) {
				selectedCats.addItem(category);
			} else {
				selectedCats.removeItemAt(selectedCats.getItemIndex(category));
			}
			
			var num:int = selectedCats.length;
			for each (var cat:Category in selectedCats) {
				cat.num = num;
			}
			
		}

	}
}